//
//  OwlCalculateLinesTestCase.m
//  Owl
//
//  Created by Tianzhou on 09-1-13.
//  Copyright 2009 Tianzhou Software Inc.. All rights reserved.
//

#import "OwlCalculateLinesTestCase.h"
#import "OwlDocument.h"


@implementation OwlCalculateLinesTestCase

- (void)test1CacluateLineSingleFile
{
	struct TestData
	{
		NSString *name;
		int totalLines;
	}testData[] =
	{
		{@"Foo1",15},
	};
	
	NSBundle *testBundle = [NSBundle bundleForClass:[self class]];
	int lineCount = 0;
	for (size_t i = 0; i < sizeof(testData)/sizeof(struct TestData); ++i)
	{
		NSString *path = [testBundle pathForResource:testData[i].name
										      ofType:@"test"];
		NSLog(@"%@",path);
		STAssertNotNil(path,@"test %u file not found",i);
		lineCount = [OwlDocument calculateLineCountForFile:[testData[i].name stringByAppendingString:@".test"]
												  atFolder:[testBundle resourcePath]];
		STAssertEquals(lineCount
					   ,testData[i].totalLines
					   ,@"test %u file line not match",i);
		
	}
}

@end
